﻿@{
    ViewBag.Title = "CompareTwoText";
}

<section id="CompareTwoText">
    <div class="clearfix">
        <textarea id="text1" rows="10" class="pull-left"></textarea>
        <textarea id="text2" rows="10" class="pull-right"></textarea>
        <a href="javascript:void(0)" class="easyui-linkbutton pull-right">对比</a>
    </div>
    <div id="result">

    </div>
</section>

<style type="text/css">
    #CompareTwoText textarea {
        width: 50%;
    }
</style>
<script type="text/javascript">
    $('.easyui-linkbutton', '#CompareTwoText').click(function () {
        var $result = $('#result', '#CompareTwoText').html('');

        $.ajax({
            url: '/Laboratory/PanGuSegment/CompareText/',
            type: 'POST',
            async: true,
            data: {
                text1: $('#text1').val(),
                text2: $('#text2').val()
            }
        }).then(function (data) {
            $('<div />').addClass('pull-left')
                .html('相似率：' + data)
                .appendTo($result);
        });
    });
</script>
